package com.example.venue_reservation_service.controller;


import com.example.venue_reservation_service.domain.Reply;
import com.example.venue_reservation_service.dto.ReplyDTO;
import com.example.venue_reservation_service.service.ReplyService;
import com.example.venue_reservation_service.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 回复记录表 前端控制器
 * </p>
 *
 * @author author
 * @since 2025-06-21
 */
@RestController
@RequestMapping("/reply")
@Api("管理员回复管理")
@CrossOrigin
public class ReplyController {

    @Autowired
    private ReplyService replyService;

    @ApiOperation("设置回复")
    @PostMapping("/create")
    public Result createReply(@RequestBody ReplyDTO dto) {
        return replyService.createReply(dto);
    }

    /**
     * 查看问题的回复
     * @param id
     * @return
     */
    @ApiOperation("查看回复")
    @GetMapping("/view")
    public Result view(@RequestParam("questionId") Integer id){
        return replyService.viewReply(id);
    }

}
